Merge | Enable SqlClientDiagnosticListener in SqlCommand on .NET Framework #3658
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This picks up where #3493 left off. Now that the SqlCommand methods with instrumentation have been merged, I've enabled the SqlClientDiagnosticListener functionality on the class.
I also noticed that tests in the DiagnosticTest class were passing unexpectedly, so dug a little deeper. These tests currently verify that the diagnostics we receive have a valid structure, but don't verify that we receive all of the diagnostics we expect to. I've modified the test to tighten this logic and explicitly specify the diagnostics we expect each scenario to receive.
@benrr101 I think we've passed the point where I'm likely to generate merge conflicts, but I'm happy to re-merge if you think that's likely.
Issues
Contributes to #1261.
Testing
Automated tests pass (even with the stricter validation.) Could someone run CI please?